﻿// -----------------------------------------------------------------------
// <copyright file="TextureInfo.cs" company="Intermedia.NET">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

using System;
using System.ComponentModel;

namespace RayDen.Library.Entity.Scene
{
    using RayDen.Library.Core.Primitives;

    [TypeConverter(typeof(ExpandableObjectConverter))]
    [Serializable]
    public abstract class TextureInfo
    {
        public string Name { get; set; }
    }

    [Serializable]
    public class ImageTextureInfo : TextureInfo
    {
        public string FilePath { get; set; }
    }

    [Serializable]
    public class SolidTextureInfo : TextureInfo
    {
        public TextureInfo BaseTexture { get; set; }

        public string Expression { get; set; }

        public ImageTextureInfo BaseImageTexture
        {
            get
            {
                if (BaseTexture is ImageTextureInfo)
                    return (BaseTexture as ImageTextureInfo);
                return null;
            }
        }

        public ConstTextureInfo BaseConstTexture
        {
            get
            {
                if (BaseTexture is ConstTextureInfo)
                    return (BaseTexture as ConstTextureInfo);
                return null;
            }
        }
    }

    [Serializable]
    public class ConstTextureInfo : TextureInfo
    {
        public RgbSpectrumInfo Color { get; set; }
    }

    [Serializable]
    public enum TextureType
    {
        Diffuse,
        Bump,
        Normal,
        Reflection,
        Alpha,
        Roughness,
        Specular,
        Gloss,
        Refraction,
    }

}
